public class Taxi {

	String[][] taxi = new String[5][2];
	private int zaehler = 1;
	
	public Taxi(Human driver){
		taxi[0][0] = driver.getForename();
		taxi[0][1] = driver.getName();
		System.out.println("The drivers name is "+taxi[0][0]+" "+taxi[0][1]+".");
	}
	
	public String getDriverName(){
		return (taxi[0][0]+" "+taxi[0][1]);
	}
	
	public void add(Human x){
		if(zaehler==5){
			System.out.println("We are sorry, "+x.getForename()+" "+x.getName()+". The taxi is full.");
			return;
		}
		taxi[zaehler][0] = x.getForename();
		taxi[zaehler][1] = x.getName();
		System.out.println(taxi[zaehler][0]+" "+taxi[zaehler][1]+" ist eingestiegen.");
		zaehler++;
	}
	
	public Human[] allGetOut(){
		zaehler=1;
		System.out.println("Taxi frei");
		Human passengers[] = new Human[4];
		Human a = new Human(taxi[1][0], taxi[1][1]);
		Human b = new Human(taxi[2][0], taxi[2][1]);
		Human c = new Human(taxi[3][0], taxi[3][1]);
		Human d = new Human(taxi[4][0], taxi[4][1]);
		passengers[0] = a;
		passengers[1] = b;
		passengers[2] = c;
		passengers[3] = d;
		return passengers;
	}
	
	public String toString(){
		
		String taxiStatus="";
		System.out.println("Zaehler ist gleich "+zaehler);
		switch (zaehler){
		case 0: taxiStatus ="empty";
		case 1: taxiStatus = "This is the taxi of "+taxi[0][0]+" "+taxi[0][1]+". He takes nobody along.";break;
		case 2: taxiStatus = "This is the taxi of "+taxi[0][0]+" "+taxi[0][1]+". He takes "+taxi[1][0]+" "+taxi[1][1]+" along.";break;
		case 3: taxiStatus = "This is the taxi of "+taxi[0][0]+" "+taxi[0][1]+". He takes "+taxi[1][0]+" "+taxi[1][1]+" and "+taxi[2][0]+" "+taxi[2][1]+" along.";break;
		case 4: taxiStatus = "This is the taxi of "+taxi[0][0]+" "+taxi[0][1]+". He takes "+taxi[1][0]+" "+taxi[1][1]+", "+taxi[2][0]+" "+taxi[2][1]+" and "+taxi[3][0]+" "+taxi[3][1]+" along.";break;
		case 5: taxiStatus = "This is the taxi of "+taxi[0][0]+" "+taxi[0][1]+". He takes "+taxi[1][0]+" "+taxi[1][1]+", "+taxi[2][0]+" "+taxi[2][1]+", "+taxi[3][0]+" "+taxi[3][1]+" and "+taxi[4][0]+" "+taxi[4][1]+" along.";break;
		}
		return taxiStatus;
	}
}
